
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <memory>
#include <stdint.h>
#include <stdio.h>
#include "render/ColorPeriodRender.h"
#include "render/TextureMixRender.h"
#include "render/TextureRender.h"
#include "render/TextureRender2.h"
#include "render/VertexColorRender.h"
#include "render/SquareRender.h"
#include "render/SquareRender2.h"
#include "render/TriangleRender.h"
#include "render/VertexColorRender.h"
#include "RenderFactory.h"
#include "SnRender.h"
#include "SnWindow.h"
#include "render/VideoPboRender.h"
#include "render/YUVRender.h"
#include "render/YUVPboRender.h"

using namespace Sivin;

static constexpr int kWidth = 1080;
static constexpr int kHeight = 720;


int main() {

  SnWindow window{kWidth, kHeight, ""};

  // std::unique_ptr<SnRender> render = RenderFactory::create<TriangleRender>();
  // std::unique_ptr<SnRender> render = RenderFactory::create<SquareRender2>();
  // std::unique_ptr<SnRender> render = RenderFactory::create<SquareRender>();
  // std::unique_ptr<SnRender> render = RenderFactory::create<ColorPeriodRender>();
  // std::unique_ptr<SnRender> render = RenderFactory::create<VertexColorRender>();
  // std::unique_ptr<SnRender> render = RenderFactory::create<TextureRender>();
  // std::unique_ptr<SnRender> render = RenderFactory::create<TextureRender2>();
  // std::unique_ptr<SnRender> render = RenderFactory::create<TextureMixRender>();
  // std::unique_ptr<SnRender> render = RenderFactory::create<YUVRender>();
  std::unique_ptr<SnRender> render = RenderFactory::create<YUVPBORender>();
  // std::unique_ptr<SnRender> render = RenderFactory::create<VideoPboRender>();

  window.setRender(std::move(render));
  if (window.init()) {
    window.show();
  }
  return EXIT_SUCCESS;
}


int a = 720;
uint8_t func() {
  return a;
}